package top.toptimus.dto.order.orderSync;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.util.DateTimeUtil;
import top.toptimus.util.ValueUtil;

import java.util.Date;
import java.util.Map;

/**
 * 款式Dto
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class StyleDTO {
    private String SYS_STYLE_ID;
    private String STYLE_NO;
    private String STYLE_CD;
    private String STYLE_KBN;
    private String STYLE_SOURCE;
    private String STYLE_CATEGORY_CD;
    private String REF_STYLE_ID;
    private String STYLE_NAME_CN;
    private String STYLE_NAME_EN;
    private String STYLE_FIT_CD;
    private String SYTLE_YEAR;
    private String SYTLE_SEASON;
    private String SYTLE_FABRIC_ID;
    private String SYTLE_FABRIC_NO;
    private String STYLE_COMPOSITION;
    private String STYLE_DESCRIBE;
    private String STYLE_COLOR_CD;
    private String STYLE_COLOR_NAME;
    private String STYLE_SIZE_GROUP_CD;
    private String STYLE_SIZE_CD;
    private String STYLE_MAKE_TYPE;
    private String STYLE_FIT_BODY_TYPE;
    private String STYLE_SEX_CD;
    private String STYLE_STANDARD;
    private String STYLE_BAR_CODE;
    private Date STYLE_DESIGNER_DATE;
    private int STYLE_DESIGNER;
    private String STYLE_MATERIAL_NUMBER;
    private String STYLE_DESIGN_PRICE;
    private String STYLE_FACTORY_TOTAL_PRICE;
    private String STYLE_SHOP_TOTAL_PRICE;
    private String REMARKS;
    private String ENABLE_FLAG;
    private String DELETE_FLAG;
    private String VERSION;
    private String CREATE_DATE;
    private String UPDATE_DATE;
    private String CREATE_USER;
    private int UPDATE_USER;

    /**
     * 款式map
     *
     * @param map 结果集
     */
    @Deprecated
    public StyleDTO(Map<String, Object> map) {
        this.SYS_STYLE_ID = map.containsKey("SYS_STYLE_ID") ? map.get("SYS_STYLE_ID").toString() : "";
        this.STYLE_NO = map.containsKey("STYLE_NO") ? map.get("STYLE_NO").toString() : "";
        this.STYLE_CD = map.containsKey("STYLE_CD") ? map.get("STYLE_CD").toString() : "";
        this.STYLE_KBN = map.containsKey("STYLE_KBN") ? map.get("STYLE_KBN").toString() : "";
        this.STYLE_SOURCE = map.containsKey("STYLE_SOURCE") ? map.get("STYLE_SOURCE").toString() : "";
        this.STYLE_CATEGORY_CD = map.containsKey("STYLE_CATEGORY_CD") ? map.get("STYLE_CATEGORY_CD").toString() : "";
        this.REF_STYLE_ID = map.containsKey("REF_STYLE_ID") ? map.get("REF_STYLE_ID").toString() : "";
        this.STYLE_NAME_CN = map.containsKey("STYLE_NAME_CN") ? map.get("STYLE_NAME_CN").toString() : "";
        this.STYLE_NAME_EN = map.containsKey("STYLE_NAME_EN") ? map.get("STYLE_NAME_EN").toString() : "";
        this.STYLE_FIT_CD = map.containsKey("STYLE_FIT_CD") ? map.get("STYLE_FIT_CD").toString() : "";
        this.SYTLE_YEAR = map.containsKey("SYTLE_YEAR") ? map.get("SYTLE_YEAR").toString() : "";
        this.SYTLE_SEASON = map.containsKey("SYTLE_SEASON") ? map.get("SYTLE_SEASON").toString() : "";
        this.SYTLE_FABRIC_ID = map.containsKey("SYTLE_FABRIC_ID") ? map.get("SYTLE_FABRIC_ID").toString() : "";
        this.SYTLE_FABRIC_NO = map.containsKey("SYTLE_FABRIC_NO") ? map.get("SYTLE_FABRIC_NO").toString() : "";
        this.STYLE_COMPOSITION = map.containsKey("STYLE_COMPOSITION") ? map.get("STYLE_COMPOSITION").toString() : "";
        this.STYLE_DESCRIBE = map.containsKey("STYLE_DESCRIBE") ? map.get("STYLE_DESCRIBE").toString() : "";
        this.STYLE_COLOR_CD = map.containsKey("STYLE_COLOR_CD") ? map.get("STYLE_COLOR_CD").toString() : "";
        this.STYLE_COLOR_NAME = map.containsKey("STYLE_COLOR_NAME") ? map.get("STYLE_COLOR_NAME").toString() : "";
        this.STYLE_SIZE_GROUP_CD = map.containsKey("STYLE_SIZE_GROUP_CD") ? map.get("STYLE_SIZE_GROUP_CD").toString() : "";
        this.STYLE_SIZE_CD = map.containsKey("STYLE_SIZE_CD") ? map.get("STYLE_SIZE_CD").toString() : "";
        this.STYLE_MAKE_TYPE = map.containsKey("STYLE_MAKE_TYPE") ? map.get("STYLE_MAKE_TYPE").toString() : "";
        this.STYLE_FIT_BODY_TYPE = map.containsKey("STYLE_FIT_BODY_TYPE") ? map.get("STYLE_FIT_BODY_TYPE").toString() : "";
        this.STYLE_SEX_CD = map.containsKey("STYLE_SEX_CD") ? map.get("STYLE_SEX_CD").toString() : "";
        this.STYLE_STANDARD = map.containsKey("STYLE_STANDARD") ? map.get("STYLE_STANDARD").toString() : "";
        this.STYLE_BAR_CODE = map.containsKey("STYLE_BAR_CODE") ? map.get("STYLE_BAR_CODE").toString() : "";
        this.STYLE_DESIGNER_DATE = DateTimeUtil.strToDateLong(map.containsKey("STYLE_DESIGNER_DATE") ? map.get("STYLE_DESIGNER_DATE").toString() : "");
        this.STYLE_DESIGNER = ValueUtil.IntNullValue(map.containsKey("STYLE_DESIGNER") ? map.get("STYLE_DESIGNER").toString() : "");
        this.STYLE_MATERIAL_NUMBER = map.containsKey("STYLE_MATERIAL_NUMBER") ? map.get("STYLE_MATERIAL_NUMBER").toString() : "";
        this.STYLE_DESIGN_PRICE = map.containsKey("STYLE_DESIGN_PRICE") ? map.get("STYLE_DESIGN_PRICE").toString() : "";
        this.STYLE_FACTORY_TOTAL_PRICE = map.containsKey("STYLE_FACTORY_TOTAL_PRICE") ? map.get("STYLE_FACTORY_TOTAL_PRICE").toString() : "";
        this.STYLE_SHOP_TOTAL_PRICE = map.containsKey("STYLE_SHOP_TOTAL_PRICE") ? map.get("STYLE_SHOP_TOTAL_PRICE").toString() : "";
        this.REMARKS = map.containsKey("REMARKS") ? map.get("REMARKS").toString() : "";
        this.ENABLE_FLAG = map.containsKey("ENABLE_FLAG") ? map.get("ENABLE_FLAG").toString() : "";
        this.DELETE_FLAG = map.containsKey("DELETE_FLAG") ? map.get("DELETE_FLAG").toString() : "";
        this.VERSION = map.containsKey("VERSION") ? map.get("VERSION").toString() : "";
        this.CREATE_DATE = map.containsKey("CREATE_DATE") ? map.get("CREATE_DATE").toString() : "";
        this.UPDATE_DATE = map.containsKey("UPDATE_DATE") ? map.get("UPDATE_DATE").toString() : "";
        this.CREATE_USER = map.containsKey("CREATE_USER") ? map.get("CREATE_USER").toString() : "";
        this.UPDATE_USER = ValueUtil.IntNullValue(map.containsKey("UPDATE_USER") ? map.get("UPDATE_USER").toString() : "");
    }

    public void build(Map<String, Object> stringObjectMap) {
        this.SYTLE_FABRIC_NO = stringObjectMap.get("MATERIAL_CODE").toString();
        this.STYLE_COMPOSITION = stringObjectMap.get("MATERIAL_COMPOSITION").toString();
    }

    public StyleDTO buildBarcode(String barcode) {
        this.STYLE_BAR_CODE = barcode;
        return this;
    }
}
